﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Wiki.WinClient
{
    public partial class SearchContentForm : Form
    {
        public SearchContentForm()
        {
            InitializeComponent();
        }

        private void SearchContentForm_LocationChanged(object sender, EventArgs e)
        {
            if ((this.Location.X - MainForm._x) > 25)
                MainForm._Start = false;
            else if ((this.Location.X - MainForm._x) >= 0 && (this.Location.X - MainForm._x) <= 25)
            {
                MainForm._Start = true;
                this.Location = new Point(MainForm._x, MainForm._y);
            }
        }

        private void SearchContentForm_Load(object sender, EventArgs e)
        {
            this.Location = new Point(MainForm._x, MainForm._y);

            for (double d = 0.00; d <= 2; d += 0.02)
            {

                System.Threading.Thread.Sleep(0);

                Application.DoEvents();

                this.Opacity = d;

                this.Refresh();

            }
        }
        private void Obj_MouseHover(object sender, EventArgs e)
        {
            ((PictureBox)sender).BackColor = System.Drawing.Color.FromArgb(0, 10, 17);

        }

        private void Obj_MouseLeave(object sender, EventArgs e)
        {
            ((PictureBox)sender).BackColor = Color.Transparent;
        }
        int goX, goY;
        private void Obj_MouseDown(object sender, MouseEventArgs e)
        {
            goX = ((PictureBox)sender).Location.X;
            goY = ((PictureBox)sender).Location.Y;

            ((PictureBox)sender).Location = new Point(goX + 1, goY + 1);
        }

        private void Obj_MouseUp(object sender, MouseEventArgs e)
        {
            ((PictureBox)sender).Location = new Point(goX, goY);
        }

        private void ClosePicBox_Click(object sender, EventArgs e)
        {
            this.Hide();
        }
    }
}
